WA2 Dream Communication for Windows - Patcher
==============================================

This patcher turns the Android XAPK of WHITE ALBUM2 ～ドリームコミュニケーション～ (version 1.0.7)
into the complete Windows game.


What you need
-------------
- Your WA2DC 1.0.7 XAPK. This is the file that contains jp.aquaplus.DreamCommunication.apk and the
  OBB.
- About 250 MB of free space for the game, plus about 220 MB of temporary space while it installs.
- 64-bit Windows 8 or newer (tested on Windows 10).
- A graphics driver with OpenGL, which any normal Intel, AMD or NVIDIA driver provides. A PC running
  only Windows' "Basic Display Adapter" may not start the game.


How to install
--------------
1. Copy "WA2DC Patcher.exe" and your XAPK to the PC. The patch data is inside the exe, so nothing
   else is needed: no Python, Unity, .NET, Visual C++ or DirectX package, and no internet.
2. Run "WA2DC Patcher.exe", choose your XAPK, then choose the folder for the game.
   If that folder isn't empty, a WA2DC subfolder is created inside it.
   Options:
   - Use the bundled strip art: the artwork shown in the side strips (on by default).
   - Create the 1920x1080 launcher.
3. Press Install. It takes a few minutes. The window shows the current file and the time left.
4. Press Play now, or create a desktop shortcut.


What the patcher does with your data
------------------------------------
Your XAPK is only read, never changed. The game is rebuilt from it in four kinds of steps:

- Unchanged game files are copied out of the XAPK (from the APK and the OBB inside it). Each one is
  checked against its recorded CRC32.
- Game files the port changes are rebuilt from your own copy with a small Windows delta (msdelta).
  These are the retargeted data files, the texture fixes and the two recompiled game assemblies.
- The 255 AssetBundles are unpacked, patched with a delta of a few hundred bytes, and re-compressed
  with the exact LZMA settings of the Windows build.
- The Unity 3.5.6 Windows player, version.dll (the Saves tab), the launchers and the strip art
  come from the patch data embedded in WA2DC Patcher.exe.

Every result is checked against its target CRC32. The install is assembled in a temporary staging
folder and moved into place only when everything has passed. The finished folder is byte-for-byte
the same as the reference Windows build.


Playing
-------
- WA2DC.bat starts the game in a 1024x768 window.
- WA2DC-1080p.bat switches to 1920x1080 fullscreen.
- Unity's configuration dialog appears first. The Graphics tab sets the resolution and window mode.
  The Saves tab lists your saves with the WP left in each and when it was last played; pick one, or
  pick New save to start without progress. Then click Play!.
- Alt+Enter toggles fullscreen.
- Saves are in the Documents folder inside the game folder. save.bin holds your progress and
  share.bin holds the store and DLC state. Save 1 is Documents itself; each new save gets its own
  folder in Documents\Saves. The owned DLC is unlocked in every save, new ones included.
- The store's real-money purchases are offline. The owned DLC is already unlocked, and gallery pages
  unlock with WP as in the original.
- The window can't be resized while the game runs. Use Alt+Enter or the 1080p launcher instead.


If something goes wrong
-----------------------
- A damaged or different XAPK stops the install with the name of the entry that failed. Nothing is
  written in that case.
- Cancelling removes the temporary staging folder and leaves the destination as it was.
- If WA2DC Patcher.exe was truncated or damaged in transit, the XAPK page says the embedded data is
  damaged and Next stays disabled. Download the exe again.


Silent install (for testing)
----------------------------
    "WA2DC Patcher.exe" /auto <xapk> <destination>

This installs without the wizard. It writes patcher-auto.txt next to the exe (OK, or the error) and
returns exit code 0 on success and 1 on failure. If the folder holding the exe is read-only, the log
cannot be written; the exit code is still the authoritative result.
